package cn.iocoder.yudao.module.call.dal.mysql.ivrrobotrole;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.call.controller.admin.ivrrobotrole.vo.IvrRobotRolePageReqVO;
import cn.iocoder.yudao.module.call.dal.dataobject.ivrrobotrole.IvrRobotRoleDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * ivr大模型角色 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface IvrRobotRoleMapper extends BaseMapperX<IvrRobotRoleDO> {

    default PageResult<IvrRobotRoleDO> selectPage(IvrRobotRolePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IvrRobotRoleDO>()
                .eqIfPresent(IvrRobotRoleDO::getIvrFlowId, reqVO.getIvrFlowId())
                .likeIfPresent(IvrRobotRoleDO::getCompanyName, reqVO.getCompanyName())
                .likeIfPresent(IvrRobotRoleDO::getYourName, reqVO.getYourName())
                .eqIfPresent(IvrRobotRoleDO::getCoreProduct, reqVO.getCoreProduct())
                .eqIfPresent(IvrRobotRoleDO::getCoreSellingPoint, reqVO.getCoreSellingPoint())
                .eqIfPresent(IvrRobotRoleDO::getCorePurpose, reqVO.getCorePurpose())
                .eqIfPresent(IvrRobotRoleDO::getExample, reqVO.getExample())
                .eqIfPresent(IvrRobotRoleDO::getCloseRestraint, reqVO.getCloseRestraint())
                .eqIfPresent(IvrRobotRoleDO::getSpecialRestrictions, reqVO.getSpecialRestrictions())
                .betweenIfPresent(IvrRobotRoleDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IvrRobotRoleDO::getId));
    }

}